import java.util.Scanner;
public class Test6 {
    public static void main(String[] args) {
        Scanner sca=new Scanner(System.in);
        int a=sca.nextInt();
        int sum=0;
        for (int i = 1; i <=a ; i++) {
            int ret=1;
            for (int j = 1; j <=i; j++) {
               ret*=j;
            }
            sum+=ret;
        }
        System.out.println(sum);
    }
}
